<template>
    <view class="container">
        <InterviewCard v-for="(item, index) in list" :key="index" :item="item"></InterviewCard>
    </view>
</template>
<script setup lang="ts">
import InterviewCard from '@/components/InterviewCard.vue'
import { onMounted, ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { API_getCategoryOfInter } from '@/service/home';
const categoryTitle = ref<string>("");
import type { interviewItem } from '@/type/interview'
let list = ref<interviewItem[]>([]);
onMounted(() => {
    wx.setNavigationBarTitle({
        title: categoryTitle.value
    })
})
// const categoryId = 
onLoad(async (options) => {
    console.log(options);

    categoryTitle.value = options!.title;

    let res = await API_getCategoryOfInter(parseInt(options!.id));
    list.value = res.data;
    console.log(res);

})
</script>
<style scoped lang="scss"></style>
